class Person:
  
  def __init__(self, name):
    self.name = name

  def showInfo(self):
    print('Hi, my name is {}'.format(self.name))

# 创建一个Student类, 继承自Person类
class Student(Person):
  def __init__(self, name):
    super().__init__(name)
  
  # 对父类的方法进行改写(多态)
  def showInfo(self):
    print('Hi, my name is {}. I am a student.'.format(self.name))

Alex = Student('Alex')
Alex.showInfo()
# Hi, my name is Alex. I am a student.